var eventsMgr = require('eventsMgr');
var consts = require('consts');
let CellNode = require('CellNode');
cc.Class({
    extends: CellNode,
    properties: {
        clickEnable:true,
    },
    // LIFE-CYCLE CALLBACKS:
    onLoad () {
        let self = this;
        self._super();
        self.node.on(cc.Node.EventType.TOUCH_START,self.onTouch,self);
    },
    onDestroy(){
        let self = this;
        self.node.off(cc.Node.EventType.TOUCH_START,self.onTouch,self);
    },
    start () {

    },
    onTouch(){
        let self = this;
        if (self.clickEnable){
            eventsMgr.emit(consts.EVENTS.CLICK, {target:self});
        }
    }
});
